<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\portal\controller;

use cmf\controller\AdminBaseController;
use app\portal\model\PortalPostModel;
use app\portal\service\PostService;
use app\portal\model\PortalCategoryModel;
use think\Facade\Db;
use app\admin\model\ThemeModel;

class AdlistController extends AdminBaseController
{


    public function message()
    {

        $message = Db::name('message')->paginate();
        
        $this->assign('articles', $message);
        $this->assign('page', $message);


        return $this->fetch();
    }



    /**
     * 留言删除
     * @adminMenu(
     *     'name'   => '留言删除',
     * )
     */
    public function delete()
    {
        $id = $this->request->param('id',0,'intval');
        $delete = Db::name('message')->where('id',$id)->delete();
        if ($delete == 1) {
           $this->success("删除成功！", '');
        }else{
           $this->error('删除失败');
        }

    }



}
